package com.eyas.im.server;

import com.eyas.im.protocol.decoder.StringDecoder;
import com.eyas.im.protocol.encoder.StringEncoder;
import com.eyas.im.server.nio.NIOIMServer;
import com.eyas.im.server.nio.handler.ConsoleServerHandler;

import java.io.IOException;
import java.util.concurrent.TimeUnit;

public class ServerTest1 {
    public static void main(String[] args) throws IOException, InterruptedException {
        IMServer imServer = new NIOIMServer("localhost",8888);
        new Thread(()->{
            try {
                imServer.startUp();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }).start();

//        TimeUnit.SECONDS.sleep(30);
//        System.out.println("关闭");
//        imServer.shudownGraceful();
    }
}
